﻿/**
 * Create in 2012-2-1.
 */
package kit4j.generator.keyless;

import java.awt.Color;

/**
 * 随机透明度的sRGB颜色对象生成器。
 * 
 * @author MiniKnife
 *
 */
public class RandomAlphaColorKeylessGenerator implements IKeylessGenerator<Color> {

	/**
	 * 随机数值生成器。
	 */
	private RandomIntegerKeylessGenerator rand;
	
	public RandomAlphaColorKeylessGenerator() {
		// 限定随机数的生成范围为0-255
		rand = new RandomIntegerKeylessGenerator(256);
	}

	/**
	 * @see kit4j.generator.keyless.IKeylessGenerator#next()
	 */
	@Override
	public Color next() {
		return new Color(rand.next(), rand.next(), rand.next(), rand.next());
	}
}
